﻿@model Ducu.SRV.ViewModel.Plan.EditorTemplates._NewOrEditModel
<div class="form-group">
    <label>标题（必填）：</label>
    @Html.TextBoxFor(m => m.Title, new { @class = "form-control", placeholder = "简明扼要，多个目标请分开发布" })
    @Html.ValidationMessageFor(m => m.Title)
</div>
<div class="form-group">
    <label>详细说明：</label>
    @Html.TextAreaFor(m => m.Description, new { @class = "form-control", rows = "4", placeholder = "补充你认为需要说明的其他信息。比如：求温柔/凶狠监工，最好同城/校……" })
</div>
<div class="form-group">
    <label>标签（必填）：</label>
    @Html.TextBoxFor(m => m.KeyWords, new { @class = "form-control", placeholder = "多个标签之间请用空格分开" })
    @Html.ValidationMessageFor(m => m.KeyWords)
</div>
<div class="form-group">
    <label>开始执行（必填）：</label>
    @Html.TextBoxFor(m => m.From, "{0:yyyy年MM月dd日}", new { @class = "form-control", data_provide = "datepicker", placeholder = "默认为今天" })
    @Html.ValidationMessageFor(m => m.From)
</div>
<div class="form-group">
    <label>目标结束：</label>
    @Html.TextBoxFor(m => m.To, "{0:yyyy年MM月dd日}", new { @class = "form-control", data_provide = "datepicker", placeholder = "默认为一年后" })
    @Html.ValidationMessageFor(m => m.To)
</div>
<div class="form-group">
    <label>（每周）交作业时间：</label>
    @Html.Partial("Shared/_TaskFulfilPlan", Model.FulfilWeekdays)
    <span class="field-validation-error" id="atLeastOneDay">@ViewBag.AtLeastOneDay</span>
    <script>
        $(document).ready(function () {
            $("form").submit(function () {
                var selectedDayNumber = $("input[name='DaysInWeek']:checked").length;
                if (selectedDayNumber == 0) {
                    $("#atLeastOneDay").text("* 至少选择一个交作业时间");
                    return false;
                }
            })
        })
    </script>
</div>
<div class="form-group">
    <label>交作业可延期：</label>
    <div class="input-group input-group-combined">
        @Html.DropDownListFor(m => m.Expire, new SelectList(new[] { 0, 1, 2, 3, 4, 5, 6 }), new { @class = "form-control" })
        <span class="input-group-addon">天</span>
    </div>
</div>
<div class="form-group">
    <label>每周可请假：</label>
    <div class="input-group input-group-combined">
        @Html.DropDownListFor(m => m.DaysOfLeave, new SelectList(new[] { 0, 1, 2, 3, 4, 5, 6 }), new { @class = "form-control" })
        <span class="input-group-addon">天</span>
    </div>
</div>
<div class="form-group">
    <label>证明：</label>
    @Html.TextBoxFor(m => m.Proof.Text, new { @class = "form-control", placeholder = "证据的文字描述" })
    <br />
    @Html.TextBoxFor(m => m.Proof.Url, new { @class = "form-control", placeholder = "可以访问的网址，详见说明" })
</div>
<div class="form-group">
    <label>监工最多：</label>
    <div class="input-group input-group-combined">
        @Html.DropDownListFor(m => m.MaxNumberOfSupervisors, new SelectList(Model.OptionalNumbersOfSupervisors), new { @class = "form-control" })
        <span class="input-group-addon">人</span>
    </div>
</div>